# QR-UOV Round 3 Optimized Implementations

This directory contains the optimized QR-UOV implementations:

opt
An optimized portable C implementation. No SIMD intrinsics are required.

avx2
An AVX2/BMI2-optimized implementation for x86-64 processors supporting
the AVX2 and BMI2 instruction sets.

Each implementation has its own Makefile and must be built from its respective directory.

## Requirements

The following software is required:
A C compiler, 
GNU Make, 
OpenSSL libcrypto 3.0 or later. 

OpenSSL 3.3 or later is recommended for EVP_DigestSqueeze.
The avx2 implementation additionally requires an x86-64 processor and compiler supporting the AVX2 and BMI2 instruction sets.
On macOS or BSD, install GNU Make and use "gmake" instead of "make".

## Building the opt Implementation

Change to the opt directory:
cd opt

Then run:
make

The default configuration is:
PARAM=1q127L3
PRG=aes

To select a different parameter set or public-seed expansion method:
make PARAM=<parameter set option> PRG=<PRG option>
e.g. make PARAM=3q31L10 PRG=shake

The generated executable is placed in:
build/<PARAM>-<PRG>/PQCgenKAT_sign

To display the supported parameter sets and build options:
make help

To remove generated build files:
make clean

## Building the avx2 Implementation

Change to the avx2 directory:
cd avx2

Then run:
make

To select a different parameter set or public-seed expansion method:
make PARAM=<parameter set option> PRG=<PRG option>

To display the supported parameter sets and build options:
make help

To remove generated build files:
make clean

On macOS or BSD, replace "make" with "gmake" in the commands above.

## Security Notice

These implementations do not include the timing-attack countermeasures described in Appendix A of the specification.